import request from '@/utils/request'

// 获取商品详情
export const getGoods = (id) => {
  return request({
    url: `/goods?id=${id}`
  })
}

export const getRecommands = (id) => {
  return request({
    url: `/goods/relevant?id=${id}&limit=16`
  })
}

export const getHotSellingAPI = (type) => {
  return request({
    url: '/goods/hot',
    method:'GET',
    params: {
      type
    }
  })
}

export const getGoodDetailAPI = (id) => {
  return request({
    url: '/goods',
    method:'GET',
    params: {
      id
    }
  })
}


// 加入购物车
export const addToCart = (skuId, count) => {
  return request({
    url: '/member/cart',
    method: 'POST',
    data: {
      skuId,
      count
    }
  })
}